-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat(aws): allow bedrock Application Inference Profile #9129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 3181380 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@tinque is attempting to deploy a commit to the LangChain Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
5982b00 to
2f5c28d
Compare
|
Really appreciate you taking the time to open this PR, @tinque 🙏 |
|
I totally understand @christian-bromann that the team is focused on the v1 release — congrats on that milestone! 🎉 That said, this change is quite minor and already covered by unit tests. Thanks again for your time and all the great work you’re doing with LangChain! |
2f5c28d to
40befc0
Compare
Implements #7809 and ports langchain-ai#7822 into the @langchain/aws library
16d3417 to
2ed02b2
Compare
christian-bromann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally been able to take a look at this. What do you think to just extend the documentation for model to hint users that they can also pass in a Application Inference Profile ARN? Two concerns I have with this approach:
- maintaining an additional field that represents the model in some cases
- can we guarantee that the model defined behind the profile is the same specified in
model? Should we check for that?
Thoughts?
|
Thanks Christian! 👋 Good points — here’s some context on that: About maintaining an additional About guaranteeing that the profile and model match That’s why, for now, the safest approach is to let users explicitly define both — For context, this implementation follows the same approach as #7822, which was based on the discussion in #7809. |
|
I'm also interested |
|
Hey there, |
|
It's a must have to use langsmith! |
christian-bromann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Hey @christian-bromann ! Added documentation for the inference profile feature in the README. It covers the usage and explains why we need both parameters for proper metadata tracking. Check out the latest commit and let me know if you'd like any changes! 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for AWS Bedrock Application Inference Profiles to the ChatBedrockConverse class, allowing users to route inference requests through custom endpoints that can manage cross-region traffic.
- Adds
applicationInferenceProfileparameter to override the model ID in API calls while preserving metadata tracking - Updates both streaming and non-streaming code paths to use the inference profile ARN when provided
- Includes comprehensive test coverage for the new functionality
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| libs/providers/langchain-aws/src/chat_models.ts | Adds applicationInferenceProfile property and logic to use it as modelId in ConverseCommand and ConverseStreamCommand when provided |
| libs/providers/langchain-aws/src/tests/chat_models.test.ts | Adds comprehensive test suite covering initialization, command creation with/without inference profile for both streaming and non-streaming modes |
| libs/providers/langchain-aws/README.md | Documents the new Application Inference Profiles feature with usage examples and important notes about model metadata tracking |
| .changeset/wet-taxis-heal.md | Adds changeset entry marking this as a minor version feature addition |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
christian-bromann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
@hntrl thoughts?
|
Hi @christian-bromann @hntrl |
Implements #7809 and ports #7822 into the @langchain/aws library